//: reusing/E03_CartoonWithDefCtor.java
/****************** Exercise 3 ******************
 * Even if you don't create a constructor for
 * Cartoon(), the compiler will synthesize a 
 * default constructor that calls the base-class
 * constructor. Prove that assertion.
 ***********************************************/
package com.hjj.tij4.reusing.exercises;

/**
 * 1、java会在子类的构造器中插入对父类构造器的调用
 * 2、即使不为子类创建构造器，编译器也会合成一个默认的构造器，该构造器将调用父类的构造器
 */
class CartoonWithDefCtor extends Drawing {
//!  CartoonWithDefCtor() {
//!    System.out.println("CartoonWithDefCtor constructor");
//!  }
}

public class E03_CartoonWithDefCtor {
    public static void main(String args[]) {
        new CartoonWithDefCtor();
    }
} /* Output:
Art constructor
Drawing constructor
*///:~
